<link href="_css/Demo.css" rel="stylesheet" type="text/css" media="all" />
<link href="_css/datepicker.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" media="screen" type="text/css"  href="_css/validationEngine.jquery.css" />
<link rel="stylesheet" media="screen" type="text/css" title="fiche_Css" href="_css/GestCli.css" />
<link rel="stylesheet" media="screen" type="text/css" title="fiche_Css" href="_css/affectation.css" />
<link rel="stylesheet" media="screen" type="text/css" title="fiche_Css" href="_css/fieldsets.css" />
<?php if ($_GET['step'] == 1) { ?>
<div id="main_title">Creation d'une nouvelle tourn&eacute;e</div>
<form id="formu" method="post" action="<?php echo ABS_PATH.ROOT; ?>?page=Transporteur/affectation&fct=Transporteur/affectation&step=2">
<label>Choisir un camion<label>
<select name="camion" onchange="submit()">
<option>None</option>
<?php foreach($camion AS $tmp) { ?>
<option value="<?php echo $tmp['Matricule']; ?>"><?php echo $tmp['Matricule']; ?></option>
<?php } ?>
</select>
</form>
<?php } ?>
<?php if ($_GET['step'] > 1 AND $_GET['step'] < 4) { ?>
<div id="main_title">Affectation des points de livraison</div>
<fieldset>
<legend>Tournee N&deg; <?php echo $num_tour; ?> -- Camion <?php echo $_POST['camion']; ?></legend>
<form method="post" action="<?php echo ABS_PATH.ROOT; ?>?page=Transporteur/affectation&fct=Transporteur/affectation&step=3<?php if (isset($cap_poid) AND isset($vol_cam)) { ?>&cap_poid=<?php echo $cap_poid; ?>&vol_cam=<?php echo $vol_cam; } ?>">
<br/><label>Choisir une offre<label>
<select name="offre">
<option>None</option>
<?php foreach($offre AS $tmp) { ?>
<option value="<?php echo $tmp; ?>"><?php echo $tmp; ?></option>
<?php } ?>
</select><br /><br/>
<label>Definir la date pr&eacute;visionelle de livraison : </label><input type="text" id="date_prevue" name="date_prevue" class="w8em dateformat-Y-ds-m-ds-d range-low-today"/><br /><br/>
<label>Heure de livraison previsionnelle (hh:mm) : </label><input type="text" name="heure" size="12" /><br /><br/>
<label>Delais de la livraison : </label><input type="text" name="h_delai" size="12" />
<input type="hidden" name="camion" value="<?php echo $_POST['camion']; ?>" /><br /><br />
<input type="submit">
</form>
</fieldset>
<center>
<div id="verif"><?php if (isset($verif)) {echo $verif;} 
		if (isset($aff_offre)) { ?></div></center>
	<table>
	<tr>
	<th>BL</th>
	<th>Delai de livraison</th>
	<th>Date de livraison effective</th>
	<th>Date de livraison prevue</th>
	<th>numero du colis</th>
	<th>ID tournee</th>
	</tr>
	<?php foreach ($aff_offre AS $tmp) { ?>
	<tr>
	<?php foreach ($tmp AS $disp) { ?>
	<td><?php echo $disp; ?> </td>
	<?php } ?>
	</tr>
	<?php } ?>
	</table>
	<input id="bouton" type="button" value="Valider la tournee" onClick="window.location.href ='<?php echo ABS_PATH.ROOT; ?>?page=Transporteur/affectation&fct=Transporteur/affectation&step=4'" />
	<?php } } 
if ($_GET['step'] == 4) { ?> <center>La tournee a bien ete ajoutee</center> <?php } ?>